<template>
  <el-pagination
      v-model:current-page="pagination.currentPage"
      :page-size="pagination.pageSize"
      :total="pagination.total"
      layout="prev, pager, next"
      @current-change="handleCurrentChange"
      class="pagination"
  />
</template>

<script>
export default {
  name: 'CommonPagination',
  props: {
    pagination: {
      type: Object,
      required: true
    }
  },
  methods: {
    handleCurrentChange(page) {
      this.$emit('page-change', page);
    }
  }
}
</script>

<style scoped>
.pagination {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}
</style>
